import {
  createRouter,
  createWebHistory,
  createWebHashHistory,
} from 'vue-router';

const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/index',
    },
    {
      path: '/index',
      component: () => import('@/views/index.vue'),
      redirect: '/index/home',
      children: [
        {
          path: 'home',
          component: () => import('@/views/HomeView/index.vue'),
        },
      ],
    },
    // 404
    {
      path: '/:pathMatch(.*)*',
      component: () => import('@/views/error/404.vue'),
    },
  ],
});

export default router;
